package com.ssn.observer.school;

import java.util.ArrayList;

public class Dept implements Subject{
    private String deptName;
    ArrayList<Observer> observers = new ArrayList<>();
    Dept(){
        deptName = "计科";
    }

    @Override
    public void attach(Observer observer) {
        observers.add(observer);
    }

    @Override
    public void detach(Observer observer) {
        observers.remove(observer);
    }

    @Override
    public void notify(Object o) {
        for (Observer ob : observers) {
            ob.update(o);
        }
    }
}
